home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 25 / AACD 25.iso / AACD / Sound / MSE / IRShell.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1998-01-25  |  958 b   |  60 lines

  1. /*
  2.         Interactive ARexx expression processor
  3.         $VER: IRShell.rexx (30 Apr 1997)
  4.  
  5.         Author: dhomas trenn (dhomas@youngmonkey.ca)
  6. */
  7.  
  8.  
  9. signal on error
  10. signal on failure
  11. signal on syntax
  12.  
  13. if ~divert("CON:0/288/640/112/IRShell v97.04.30/CLOSE/SCREEN MSE") then exit
  14. say "cxy"
  15.  
  16. rc = 0
  17. options prompt "> "
  18.  
  19.  
  20. options results
  21.  
  22.  
  23. Input:
  24.     do forever
  25.         parse pull line
  26.         if eof(stdin) then exit
  27.         if  line = "=" then
  28.             interpret 'say "RESULT = "RESULT'
  29.         else if left(line,1) = "=" then
  30.             interpret say substr(line, 2)
  31.         else
  32.             interpret line
  33.     end
  34.  
  35.  
  36. divert: procedure
  37.  
  38.     call close(stdout)
  39.     call close(stdin )
  40.     success = 0
  41.     if open(stdout,arg(1),"w") then do
  42.         call pragma("*",stdout)
  43.         if open(stdin,"*","r") then
  44.             success = 1
  45.         else
  46.             call close(stdout)
  47.     end
  48.     if ~success then do
  49.         call pragma("*")
  50.         call open(stdout,"*","w")
  51.         call open(stdin, "*","r")
  52.     end
  53. return success
  54.  
  55.  
  56. error:
  57. failure:
  58. syntax:
  59.     say " Error: RC= "rc; signal Input
  60.